package com.doyoulearn.websocket.controller;

import com.doyoulearn.websocket.service.WebAlarmSocketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.stereotype.Controller;

@Controller
public class WebAlarmControllerV2 {

    @Autowired
    private WebAlarmSocketService webAlarmSocketService;

    @MessageMapping("/web/alarm/in")
    public void alarm(String userId) {
        System.err.println("userId:" + userId);
        webAlarmSocketService.sendMessage(userId);
    }


}
